/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DSENS;

/**
 *
 * @author teeteto
 */



public class Log extends AbstractLog{


    @Override
    public void printEvent(Event e) throws LogException{
        try{
            if(e!=null) {
                this.printTime();
                e.printEvent();}
            else throw new LogException("Error: Event is null");
        }
        catch(LogException le){
            le.printStackTrace();
        }
    }

    public void printEvent(Event e, String comment) throws LogException{
        try{
            if(e!=null) {
                this.printTime();
                e.printEvent(comment);}
            else throw new LogException("Error: Event is null");
        }
        catch(LogException le){
            le.printStackTrace();
        }
    }

    @Override
    public void printNode(Node n) throws LogException{
        try{
            if(n!=null){
               n.printNode();
            }
            else throw new LogException("Error: Null is null");
        }
        catch(LogException le){
            le.printStackTrace();
        }
    }

    @Override
    public void printMessage(Message m) throws LogException{
        try{
            if(m!=null){
                m.printMessage();
             }
            else throw new LogException("Error: Message is null");
        }
        catch(LogException le){
            le.printStackTrace();
        }
    }

    @Override
    public void printLog(String l){
        this.printTime();
        System.out.print(l);
    }

    @Override
    public void printlnLog(String l){
        this.printTime();
        System.out.println(l);
    }

}
